﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

namespace SchoolProject2012.Functions
{
    public class Utils
    {
        public static string getMimeType(string file)
        {
            string mime="";
            string extension = Path.GetExtension(file).ToLower();
            switch (extension)
            {
                case ".323": mime = "text/h323";
		        break;
                case ".3g2": mime = "video/3gpp2";
		        break;
                case ".3gp": mime = "video/3gpp";
		        break;
                case ".3gp2": mime = "video/3gpp2";
		        break;
                case ".3gpp": mime = "video/3gpp";
		        break;
                case ".7z": mime = "application/x-7z-compressed";
		        break;
                case ".aa": mime = "audio/audible";
		        break;
                case ".AAC": mime = "audio/aac";
		        break;
                case ".aaf": mime = "application/octet-stream";
		        break;
                case ".aax": mime = "audio/vnd.audible.aax";
		        break;
                case ".ac3": mime = "audio/ac3";
		        break;
                case ".aca": mime = "application/octet-stream";
		        break;
                case ".accda": mime = "application/msaccess.addin";
		        break;
                case ".accdb": mime = "application/msaccess";
		        break;
                case ".accdc": mime = "application/msaccess.cab";
		        break;
                case ".accde": mime = "application/msaccess";
		        break;
                case ".accdr": mime = "application/msaccess.runtime";
		        break;
                case ".accdt": mime = "application/msaccess";
		        break;
                case ".accdw": mime = "application/msaccess.webapplication";
		        break;
                case ".accft": mime = "application/msaccess.ftemplate";
		        break;
                case ".acx": mime = "application/internet-property-stream";
		        break;
                case ".AddIn": mime = "text/xml";
		        break;
                case ".ade": mime = "application/msaccess";
		        break;
                case ".adobebridge": mime = "application/x-bridge-url";
		        break;
                case ".adp": mime = "application/msaccess";
		        break;
                case ".ADT": mime = "audio/vnd.dlna.adts";
		        break;
                case ".ADTS": mime = "audio/aac";
		        break;
                case ".afm": mime = "application/octet-stream";
		        break;
                case ".ai": mime = "application/postscript";
		        break;
                case ".aif": mime = "audio/x-aiff";
		        break;
                case ".aifc": mime = "audio/aiff";
		        break;
                case ".aiff": mime = "audio/aiff";
		        break;
                case ".air": mime = "application/vnd.adobe.air-application-installer-package+zip";
		        break;
                case ".amc": mime = "application/x-mpeg";
		        break;
                case ".application": mime = "application/x-ms-application";
		        break;
                case ".art": mime = "image/x-jg";
		        break;
                case ".asa": mime = "application/xml";
		        break;
                case ".asax": mime = "application/xml";
		        break;
                case ".ascx": mime = "application/xml";
		        break;
                case ".asd": mime = "application/octet-stream";
		        break;
                case ".asf": mime = "video/x-ms-asf";
		        break;
                case ".ashx": mime = "application/xml";
		        break;
                case ".asi": mime = "application/octet-stream";
		        break;
                case ".asm": mime = "text/plain";
		        break;
                case ".asmx": mime = "application/xml";
		        break;
                case ".aspx": mime = "application/xml";
		        break;
                case ".asr": mime = "video/x-ms-asf";
		        break;
                case ".asx": mime = "video/x-ms-asf";
		        break;
                case ".atom": mime = "application/atom+xml";
		        break;
                case ".au": mime = "audio/basic";
		        break;
                case ".avi": mime = "video/x-msvideo";
		        break;
                case ".axs": mime = "application/olescript";
		        break;
                case ".bas": mime = "text/plain";
		        break;
                case ".bcpio": mime = "application/x-bcpio";
		        break;
                case ".bin": mime = "application/octet-stream";
		        break;
                case ".bmp": mime = "image/bmp";
		        break;
                case ".c": mime = "text/plain";
		        break;
                case ".cab": mime = "application/octet-stream";
		        break;
                case ".caf": mime = "audio/x-caf";
		        break;
                case ".calx": mime = "application/vnd.ms-office.calx";
		        break;
                case ".cat": mime = "application/vnd.ms-pki.seccat";
		        break;
                case ".cc": mime = "text/plain";
		        break;
                case ".cd": mime = "text/plain";
		        break;
                case ".cdda": mime = "audio/aiff";
		        break;
                case ".cdf": mime = "application/x-cdf";
		        break;
                case ".cer": mime = "application/x-x509-ca-cert";
		        break;
                case ".chm": mime = "application/octet-stream";
		        break;
                case ".class": mime = "application/x-java-applet";
		        break;
                case ".clp": mime = "application/x-msclip";
		        break;
                case ".cmx": mime = "image/x-cmx";
		        break;
                case ".cnf": mime = "text/plain";
		        break;
                case ".cod": mime = "image/cis-cod";
		        break;
                case ".config": mime = "application/xml";
		        break;
                case ".contact": mime = "text/x-ms-contact";
		        break;
                case ".coverage": mime = "application/xml";
		        break;
                case ".cpio": mime = "application/x-cpio";
		        break;
                case ".cpp": mime = "text/plain";
		        break;
                case ".crd": mime = "application/x-mscardfile";
		        break;
                case ".crl": mime = "application/pkix-crl";
		        break;
                case ".crt": mime = "application/x-x509-ca-cert";
		        break;
                case ".cs": mime = "text/plain";
		        break;
                case ".csdproj": mime = "text/plain";
		        break;
                case ".csh": mime = "application/x-csh";
		        break;
                case ".csproj": mime = "text/plain";
		        break;
                case ".css": mime = "text/css";
		        break;
                case ".csv": mime = "application/octet-stream";
		        break;
                case ".cur": mime = "application/octet-stream";
		        break;
                case ".cxx": mime = "text/plain";
		        break;
                case ".dat": mime = "application/octet-stream";
		        break;
                case ".datasource": mime = "application/xml";
		        break;
                case ".dbproj": mime = "text/plain";
		        break;
                case ".dcr": mime = "application/x-director";
		        break;
                case ".def": mime = "text/plain";
		        break;
                case ".deploy": mime = "application/octet-stream";
		        break;
                case ".der": mime = "application/x-x509-ca-cert";
		        break;
                case ".dgml": mime = "application/xml";
		        break;
                case ".dib": mime = "image/bmp";
		        break;
                case ".dif": mime = "video/x-dv";
		        break;
                case ".dir": mime = "application/x-director";
		        break;
                case ".disco": mime = "text/xml";
		        break;
                case ".dll": mime = "application/x-msdownload";
		        break;
                case ".dll.config": mime = "text/xml";
		        break;
                case ".dlm": mime = "text/dlm";
		        break;
                case ".doc": mime = "application/msword";
		        break;
                case ".docm": mime = "application/vnd.ms-word.document.macroEnabled.12";
		        break;
                case ".docx": mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
		        break;
                case ".dot": mime = "application/msword";
		        break;
                case ".dotm": mime = "application/vnd.ms-word.template.macroEnabled.12";
		        break;
                case ".dotx": mime = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
		        break;
                case ".dsp": mime = "application/octet-stream";
		        break;
                case ".dsw": mime = "text/plain";
		        break;
                case ".dtd": mime = "text/xml";
		        break;
                case ".dtsConfig": mime = "text/xml";
		        break;
                case ".dv": mime = "video/x-dv";
		        break;
                case ".dvi": mime = "application/x-dvi";
		        break;
                case ".dwf": mime = "drawing/x-dwf";
		        break;
                case ".dwp": mime = "application/octet-stream";
		        break;
                case ".dxr": mime = "application/x-director";
		        break;
                case ".eml": mime = "message/rfc822";
		        break;
                case ".emz": mime = "application/octet-stream";
		        break;
                case ".eot": mime = "application/octet-stream";
		        break;
                case ".eps": mime = "application/postscript";
		        break;
                case ".etl": mime = "application/etl";
		        break;
                case ".etx": mime = "text/x-setext";
		        break;
                case ".evy": mime = "application/envoy";
		        break;
                case ".exe": mime = "application/octet-stream";
		        break;
                case ".exe.config": mime = "text/xml";
		        break;
                case ".fdf": mime = "application/vnd.fdf";
		        break;
                case ".fif": mime = "application/fractals";
		        break;
                case ".filters": mime = "Application/xml";
		        break;
                case ".fla": mime = "application/octet-stream";
		        break;
                case ".flr": mime = "x-world/x-vrml";
		        break;
                case ".flv": mime = "video/x-flv";
		        break;
                case ".fsscript": mime = "application/fsharp-script";
		        break;
                case ".fsx": mime = "application/fsharp-script";
		        break;
                case ".generictest": mime = "application/xml";
		        break;
                case ".gif": mime = "image/gif";
		        break;
                case ".group": mime = "text/x-ms-group";
		        break;
                case ".gsm": mime = "audio/x-gsm";
		        break;
                case ".gtar": mime = "application/x-gtar";
		        break;
                case ".gz": mime = "application/x-gzip";
		        break;
                case ".h": mime = "text/plain";
		        break;
                case ".hdf": mime = "application/x-hdf";
		        break;
                case ".hdml": mime = "text/x-hdml";
		        break;
                case ".hhc": mime = "application/x-oleobject";
		        break;
                case ".hhk": mime = "application/octet-stream";
		        break;
                case ".hhp": mime = "application/octet-stream";
		        break;
                case ".hlp": mime = "application/winhlp";
		        break;
                case ".hpp": mime = "text/plain";
		        break;
                case ".hqx": mime = "application/mac-binhex40";
		        break;
                case ".hta": mime = "application/hta";
		        break;
                case ".htc": mime = "text/x-component";
		        break;
                case ".htm": mime = "text/html";
		        break;
                case ".html": mime = "text/html";
		        break;
                case ".htt": mime = "text/webviewhtml";
		        break;
                case ".hxa": mime = "application/xml";
		        break;
                case ".hxc": mime = "application/xml";
		        break;
                case ".hxd": mime = "application/octet-stream";
		        break;
                case ".hxe": mime = "application/xml";
		        break;
                case ".hxf": mime = "application/xml";
		        break;
                case ".hxh": mime = "application/octet-stream";
		        break;
                case ".hxi": mime = "application/octet-stream";
		        break;
                case ".hxk": mime = "application/xml";
		        break;
                case ".hxq": mime = "application/octet-stream";
		        break;
                case ".hxr": mime = "application/octet-stream";
		        break;
                case ".hxs": mime = "application/octet-stream";
		        break;
                case ".hxt": mime = "text/html";
		        break;
                case ".hxv": mime = "application/xml";
		        break;
                case ".hxw": mime = "application/octet-stream";
		        break;
                case ".hxx": mime = "text/plain";
		        break;
                case ".i": mime = "text/plain";
		        break;
                case ".ico": mime = "image/x-icon";
		        break;
                case ".ics": mime = "application/octet-stream";
		        break;
                case ".idl": mime = "text/plain";
		        break;
                case ".ief": mime = "image/ief";
		        break;
                case ".iii": mime = "application/x-iphone";
		        break;
                case ".inc": mime = "text/plain";
		        break;
                case ".inf": mime = "application/octet-stream";
		        break;
                case ".inl": mime = "text/plain";
		        break;
                case ".ins": mime = "application/x-internet-signup";
		        break;
                case ".ipa": mime = "application/x-itunes-ipa";
		        break;
                case ".ipg": mime = "application/x-itunes-ipg";
		        break;
                case ".ipproj": mime = "text/plain";
		        break;
                case ".ipsw": mime = "application/x-itunes-ipsw";
		        break;
                case ".iqy": mime = "text/x-ms-iqy";
		        break;
                case ".isp": mime = "application/x-internet-signup";
		        break;
                case ".ite": mime = "application/x-itunes-ite";
		        break;
                case ".itlp": mime = "application/x-itunes-itlp";
		        break;
                case ".itms": mime = "application/x-itunes-itms";
		        break;
                case ".itpc": mime = "application/x-itunes-itpc";
		        break;
                case ".IVF": mime = "video/x-ivf";
		        break;
                case ".jar": mime = "application/java-archive";
		        break;
                case ".java": mime = "application/octet-stream";
		        break;
                case ".jck": mime = "application/liquidmotion";
		        break;
                case ".jcz": mime = "application/liquidmotion";
		        break;
                case ".jfif": mime = "image/pjpeg";
		        break;
                case ".jnlp": mime = "application/x-java-jnlp-file";
		        break;
                case ".jpb": mime = "application/octet-stream";
		        break;
                case ".jpe": mime = "image/jpeg";
		        break;
                case ".jpeg": mime = "image/jpeg";
		        break;
                case ".jpg": mime = "image/jpeg";
		        break;
                case ".js": mime = "application/x-javascript";
		        break;
                case ".jsx": mime = "text/jscript";
		        break;
                case ".jsxbin": mime = "text/plain";
		        break;
                case ".latex": mime = "application/x-latex";
		        break;
                case ".library-ms": mime = "application/windows-library+xml";
		        break;
                case ".lit": mime = "application/x-ms-reader";
		        break;
                case ".loadtest": mime = "application/xml";
		        break;
                case ".lpk": mime = "application/octet-stream";
		        break;
                case ".lsf": mime = "video/x-la-asf";
		        break;
                case ".lst": mime = "text/plain";
		        break;
                case ".lsx": mime = "video/x-la-asf";
		        break;
                case ".lzh": mime = "application/octet-stream";
		        break;
                case ".m13": mime = "application/x-msmediaview";
		        break;
                case ".m14": mime = "application/x-msmediaview";
		        break;
                case ".m1v": mime = "video/mpeg";
		        break;
                case ".m2t": mime = "video/vnd.dlna.mpeg-tts";
		        break;
                case ".m2ts": mime = "video/vnd.dlna.mpeg-tts";
		        break;
                case ".m2v": mime = "video/mpeg";
		        break;
                case ".m3u": mime = "audio/x-mpegurl";
		        break;
                case ".m3u8": mime = "audio/x-mpegurl";
		        break;
                case ".m4a": mime = "audio/m4a";
		        break;
                case ".m4b": mime = "audio/m4b";
		        break;
                case ".m4p": mime = "audio/m4p";
		        break;
                case ".m4r": mime = "audio/x-m4r";
		        break;
                case ".m4v": mime = "video/x-m4v";
		        break;
                case ".mac": mime = "image/x-macpaint";
		        break;
                case ".mak": mime = "text/plain";
		        break;
                case ".man": mime = "application/x-troff-man";
		        break;
                case ".manifest": mime = "application/x-ms-manifest";
		        break;
                case ".map": mime = "text/plain";
		        break;
                case ".master": mime = "application/xml";
		        break;
                case ".mda": mime = "application/msaccess";
		        break;
                case ".mdb": mime = "application/x-msaccess";
		        break;
                case ".mde": mime = "application/msaccess";
		        break;
                case ".mdp": mime = "application/octet-stream";
		        break;
                case ".me": mime = "application/x-troff-me";
		        break;
                case ".mfp": mime = "application/x-shockwave-flash";
		        break;
                case ".mht": mime = "message/rfc822";
		        break;
                case ".mhtml": mime = "message/rfc822";
		        break;
                case ".mid": mime = "audio/mid";
		        break;
                case ".midi": mime = "audio/mid";
		        break;
                case ".mix": mime = "application/octet-stream";
		        break;
                case ".mk": mime = "text/plain";
		        break;
                case ".mmf": mime = "application/x-smaf";
		        break;
                case ".mno": mime = "text/xml";
		        break;
                case ".mny": mime = "application/x-msmoney";
		        break;
                case ".mod": mime = "video/mpeg";
		        break;
                case ".mov": mime = "video/quicktime";
		        break;
                case ".movie": mime = "video/x-sgi-movie";
		        break;
                case ".mp2": mime = "video/mpeg";
		        break;
                case ".mp2v": mime = "video/mpeg";
		        break;
                case ".mp3": mime = "audio/mpeg";
		        break;
                case ".mp4": mime = "video/mp4";
		        break;
                case ".mp4v": mime = "video/mp4";
		        break;
                case ".mpa": mime = "video/mpeg";
		        break;
                case ".mpe": mime = "video/mpeg";
		        break;
                case ".mpeg": mime = "video/mpeg";
		        break;
                case ".mpf": mime = "application/vnd.ms-mediapackage";
		        break;
                case ".mpg": mime = "video/mpeg";
		        break;
                case ".mpp": mime = "application/vnd.ms-project";
		        break;
                case ".mpv2": mime = "video/mpeg";
		        break;
                case ".mqv": mime = "video/quicktime";
		        break;
                case ".ms": mime = "application/x-troff-ms";
		        break;
                case ".msi": mime = "application/octet-stream";
		        break;
                case ".mso": mime = "application/octet-stream";
		        break;
                case ".mts": mime = "video/vnd.dlna.mpeg-tts";
		        break;
                case ".mtx": mime = "application/xml";
		        break;
                case ".mvb": mime = "application/x-msmediaview";
		        break;
                case ".mvc": mime = "application/x-miva-compiled";
		        break;
                case ".mxp": mime = "application/x-mmxp";
		        break;
                case ".nc": mime = "application/x-netcdf";
		        break;
                case ".nsc": mime = "video/x-ms-asf";
		        break;
                case ".nws": mime = "message/rfc822";
		        break;
                case ".ocx": mime = "application/octet-stream";
		        break;
                case ".oda": mime = "application/oda";
		        break;
                case ".odc": mime = "text/x-ms-odc";
		        break;
                case ".odh": mime = "text/plain";
		        break;
                case ".odl": mime = "text/plain";
		        break;
                case ".odp": mime = "application/vnd.oasis.opendocument.presentation";
		        break;
                case ".ods": mime = "application/oleobject";
		        break;
                case ".odt": mime = "application/vnd.oasis.opendocument.text";
		        break;
                case ".one": mime = "application/onenote";
		        break;
                case ".onea": mime = "application/onenote";
		        break;
                case ".onepkg": mime = "application/onenote";
		        break;
                case ".onetmp": mime = "application/onenote";
		        break;
                case ".onetoc": mime = "application/onenote";
		        break;
                case ".onetoc2": mime = "application/onenote";
		        break;
                case ".orderedtest": mime = "application/xml";
		        break;
                case ".osdx": mime = "application/opensearchdescription+xml";
		        break;
                case ".p10": mime = "application/pkcs10";
		        break;
                case ".p12": mime = "application/x-pkcs12";
		        break;
                case ".p7b": mime = "application/x-pkcs7-certificates";
		        break;
                case ".p7c": mime = "application/pkcs7-mime";
		        break;
                case ".p7m": mime = "application/pkcs7-mime";
		        break;
                case ".p7r": mime = "application/x-pkcs7-certreqresp";
		        break;
                case ".p7s": mime = "application/pkcs7-signature";
		        break;
                case ".pbm": mime = "image/x-portable-bitmap";
		        break;
                case ".pcast": mime = "application/x-podcast";
		        break;
                case ".pct": mime = "image/pict";
		        break;
                case ".pcx": mime = "application/octet-stream";
		        break;
                case ".pcz": mime = "application/octet-stream";
		        break;
                case ".pdf": mime = "application/pdf";
		        break;
                case ".pfb": mime = "application/octet-stream";
		        break;
                case ".pfm": mime = "application/octet-stream";
		        break;
                case ".pfx": mime = "application/x-pkcs12";
		        break;
                case ".pgm": mime = "image/x-portable-graymap";
		        break;
                case ".pic": mime = "image/pict";
		        break;
                case ".pict": mime = "image/pict";
		        break;
                case ".pkgdef": mime = "text/plain";
		        break;
                case ".pkgundef": mime = "text/plain";
		        break;
                case ".pko": mime = "application/vnd.ms-pki.pko";
		        break;
                case ".pls": mime = "audio/scpls";
		        break;
                case ".pma": mime = "application/x-perfmon";
		        break;
                case ".pmc": mime = "application/x-perfmon";
		        break;
                case ".pml": mime = "application/x-perfmon";
		        break;
                case ".pmr": mime = "application/x-perfmon";
		        break;
                case ".pmw": mime = "application/x-perfmon";
		        break;
                case ".png": mime = "image/png";
		        break;
                case ".pnm": mime = "image/x-portable-anymap";
		        break;
                case ".pnt": mime = "image/x-macpaint";
		        break;
                case ".pntg": mime = "image/x-macpaint";
		        break;
                case ".pnz": mime = "image/png";
		        break;
                case ".pot": mime = "application/vnd.ms-powerpoint";
		        break;
                case ".potm": mime = "application/vnd.ms-powerpoint.template.macroEnabled.12";
		        break;
                case ".potx": mime = "application/vnd.openxmlformats-officedocument.presentationml.template";
		        break;
                case ".ppa": mime = "application/vnd.ms-powerpoint";
		        break;
                case ".ppam": mime = "application/vnd.ms-powerpoint.addin.macroEnabled.12";
		        break;
                case ".ppm": mime = "image/x-portable-pixmap";
		        break;
                case ".pps": mime = "application/vnd.ms-powerpoint";
		        break;
                case ".ppsm": mime = "application/vnd.ms-powerpoint.slideshow.macroEnabled.12";
		        break;
                case ".ppsx": mime = "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
		        break;
                case ".ppt": mime = "application/vnd.ms-powerpoint";
		        break;
                case ".pptm": mime = "application/vnd.ms-powerpoint.presentation.macroEnabled.12";
		        break;
                case ".pptx": mime = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
		        break;
                case ".prf": mime = "application/pics-rules";
		        break;
                case ".prm": mime = "application/octet-stream";
		        break;
                case ".prx": mime = "application/octet-stream";
		        break;
                case ".ps": mime = "application/postscript";
		        break;
                case ".psc1": mime = "application/PowerShell";
		        break;
                case ".psd": mime = "application/octet-stream";
		        break;
                case ".psess": mime = "application/xml";
		        break;
                case ".psm": mime = "application/octet-stream";
		        break;
                case ".psp": mime = "application/octet-stream";
		        break;
                case ".pub": mime = "application/x-mspublisher";
		        break;
                case ".pwz": mime = "application/vnd.ms-powerpoint";
		        break;
                case ".qht": mime = "text/x-html-insertion";
		        break;
                case ".qhtm": mime = "text/x-html-insertion";
		        break;
                case ".qt": mime = "video/quicktime";
		        break;
                case ".qti": mime = "image/x-quicktime";
		        break;
                case ".qtif": mime = "image/x-quicktime";
		        break;
                case ".qtl": mime = "application/x-quicktimeplayer";
		        break;
                case ".qxd": mime = "application/octet-stream";
		        break;
                case ".ra": mime = "audio/x-pn-realaudio";
		        break;
                case ".ram": mime = "audio/x-pn-realaudio";
		        break;
                case ".rar": mime = "application/octet-stream";
		        break;
                case ".ras": mime = "image/x-cmu-raster";
		        break;
                case ".rat": mime = "application/rat-file";
		        break;
                case ".rc": mime = "text/plain";
		        break;
                case ".rc2": mime = "text/plain";
		        break;
                case ".rct": mime = "text/plain";
		        break;
                case ".rdlc": mime = "application/xml";
		        break;
                case ".resx": mime = "application/xml";
		        break;
                case ".rf": mime = "image/vnd.rn-realflash";
		        break;
                case ".rgb": mime = "image/x-rgb";
		        break;
                case ".rgs": mime = "text/plain";
		        break;
                case ".rm": mime = "application/vnd.rn-realmedia";
		        break;
                case ".rmi": mime = "audio/mid";
		        break;
                case ".rmp": mime = "application/vnd.rn-rn_music_package";
		        break;
                case ".roff": mime = "application/x-troff";
		        break;
                case ".rpm": mime = "audio/x-pn-realaudio-plugin";
		        break;
                case ".rqy": mime = "text/x-ms-rqy";
		        break;
                case ".rtf": mime = "application/rtf";
		        break;
                case ".rtx": mime = "text/richtext";
		        break;
                case ".ruleset": mime = "application/xml";
		        break;
                case ".s": mime = "text/plain";
		        break;
                case ".safariextz": mime = "application/x-safari-safariextz";
		        break;
                case ".scd": mime = "application/x-msschedule";
		        break;
                case ".sct": mime = "text/scriptlet";
		        break;
                case ".sd2": mime = "audio/x-sd2";
		        break;
                case ".sdp": mime = "application/sdp";
		        break;
                case ".sea": mime = "application/octet-stream";
		        break;
                case ".searchConnector-ms": mime = "application/windows-search-connector+xml";
		        break;
                case ".setpay": mime = "application/set-payment-initiation";
		        break;
                case ".setreg": mime = "application/set-registration-initiation";
		        break;
                case ".settings": mime = "application/xml";
		        break;
                case ".sgimb": mime = "application/x-sgimb";
		        break;
                case ".sgml": mime = "text/sgml";
		        break;
                case ".sh": mime = "application/x-sh";
		        break;
                case ".shar": mime = "application/x-shar";
		        break;
                case ".shtml": mime = "text/html";
		        break;
                case ".sit": mime = "application/x-stuffit";
		        break;
                case ".sitemap": mime = "application/xml";
		        break;
                case ".skin": mime = "application/xml";
		        break;
                case ".sldm": mime = "application/vnd.ms-powerpoint.slide.macroEnabled.12";
		        break;
                case ".sldx": mime = "application/vnd.openxmlformats-officedocument.presentationml.slide";
		        break;
                case ".slk": mime = "application/vnd.ms-excel";
		        break;
                case ".sln": mime = "text/plain";
		        break;
                case ".slupkg-ms": mime = "application/x-ms-license";
		        break;
                case ".smd": mime = "audio/x-smd";
		        break;
                case ".smi": mime = "application/octet-stream";
		        break;
                case ".smx": mime = "audio/x-smd";
		        break;
                case ".smz": mime = "audio/x-smd";
		        break;
                case ".snd": mime = "audio/basic";
		        break;
                case ".snippet": mime = "application/xml";
		        break;
                case ".snp": mime = "application/octet-stream";
		        break;
                case ".sol": mime = "text/plain";
		        break;
                case ".sor": mime = "text/plain";
		        break;
                case ".spc": mime = "application/x-pkcs7-certificates";
		        break;
                case ".spl": mime = "application/futuresplash";
		        break;
                case ".src": mime = "application/x-wais-source";
		        break;
                case ".srf": mime = "text/plain";
		        break;
                case ".SSISDeploymentManifest": mime = "text/xml";
		        break;
                case ".ssm": mime = "application/streamingmedia";
		        break;
                case ".sst": mime = "application/vnd.ms-pki.certstore";
		        break;
                case ".stl": mime = "application/vnd.ms-pki.stl";
		        break;
                case ".sv4cpio": mime = "application/x-sv4cpio";
		        break;
                case ".sv4crc": mime = "application/x-sv4crc";
		        break;
                case ".svc": mime = "application/xml";
		        break;
                case ".swf": mime = "application/x-shockwave-flash";
		        break;
                case ".t": mime = "application/x-troff";
		        break;
                case ".tar": mime = "application/x-tar";
		        break;
                case ".tcl": mime = "application/x-tcl";
		        break;
                case ".testrunconfig": mime = "application/xml";
		        break;
                case ".testsettings": mime = "application/xml";
		        break;
                case ".tex": mime = "application/x-tex";
		        break;
                case ".texi": mime = "application/x-texinfo";
		        break;
                case ".texinfo": mime = "application/x-texinfo";
		        break;
                case ".tgz": mime = "application/x-compressed";
		        break;
                case ".thmx": mime = "application/vnd.ms-officetheme";
		        break;
                case ".thn": mime = "application/octet-stream";
		        break;
                case ".tif": mime = "image/tiff";
		        break;
                case ".tiff": mime = "image/tiff";
		        break;
                case ".tlh": mime = "text/plain";
		        break;
                case ".tli": mime = "text/plain";
		        break;
                case ".toc": mime = "application/octet-stream";
		        break;
                case ".tr": mime = "application/x-troff";
		        break;
                case ".trm": mime = "application/x-msterminal";
		        break;
                case ".trx": mime = "application/xml";
		        break;
                case ".ts": mime = "video/vnd.dlna.mpeg-tts";
		        break;
                case ".tsv": mime = "text/tab-separated-values";
		        break;
                case ".ttf": mime = "application/octet-stream";
		        break;
                case ".tts": mime = "video/vnd.dlna.mpeg-tts";
		        break;
                case ".txt": mime = "text/plain";
		        break;
                case ".u32": mime = "application/octet-stream";
		        break;
                case ".uls": mime = "text/iuls";
		        break;
                case ".user": mime = "text/plain";
		        break;
                case ".ustar": mime = "application/x-ustar";
		        break;
                case ".vb": mime = "text/plain";
		        break;
                case ".vbdproj": mime = "text/plain";
		        break;
                case ".vbk": mime = "video/mpeg";
		        break;
                case ".vbproj": mime = "text/plain";
		        break;
                case ".vbs": mime = "text/vbscript";
		        break;
                case ".vcf": mime = "text/x-vcard";
		        break;
                case ".vcproj": mime = "Application/xml";
		        break;
                case ".vcs": mime = "text/plain";
		        break;
                case ".vcxproj": mime = "Application/xml";
		        break;
                case ".vddproj": mime = "text/plain";
		        break;
                case ".vdp": mime = "text/plain";
		        break;
                case ".vdproj": mime = "text/plain";
		        break;
                case ".vdx": mime = "application/vnd.ms-visio.viewer";
		        break;
                case ".vml": mime = "text/xml";
		        break;
                case ".vscontent": mime = "application/xml";
		        break;
                case ".vsct": mime = "text/xml";
		        break;
                case ".vsd": mime = "application/vnd.visio";
		        break;
                case ".vsi": mime = "application/ms-vsi";
		        break;
                case ".vsix": mime = "application/vsix";
		        break;
                case ".vsixlangpack": mime = "text/xml";
		        break;
                case ".vsixmanifest": mime = "text/xml";
		        break;
                case ".vsmdi": mime = "application/xml";
		        break;
                case ".vspscc": mime = "text/plain";
		        break;
                case ".vss": mime = "application/vnd.visio";
		        break;
                case ".vsscc": mime = "text/plain";
		        break;
                case ".vssettings": mime = "text/xml";
		        break;
                case ".vssscc": mime = "text/plain";
		        break;
                case ".vst": mime = "application/vnd.visio";
		        break;
                case ".vstemplate": mime = "text/xml";
		        break;
                case ".vsto": mime = "application/x-ms-vsto";
		        break;
                case ".vsw": mime = "application/vnd.visio";
		        break;
                case ".vsx": mime = "application/vnd.visio";
		        break;
                case ".vtx": mime = "application/vnd.visio";
		        break;
                case ".wav": mime = "audio/wav";
		        break;
                case ".wave": mime = "audio/wav";
		        break;
                case ".wax": mime = "audio/x-ms-wax";
		        break;
                case ".wbk": mime = "application/msword";
		        break;
                case ".wbmp": mime = "image/vnd.wap.wbmp";
		        break;
                case ".wcm": mime = "application/vnd.ms-works";
		        break;
                case ".wdb": mime = "application/vnd.ms-works";
		        break;
                case ".wdp": mime = "image/vnd.ms-photo";
		        break;
                case ".webarchive": mime = "application/x-safari-webarchive";
		        break;
                case ".webtest": mime = "application/xml";
		        break;
                case ".wiq": mime = "application/xml";
		        break;
                case ".wiz": mime = "application/msword";
		        break;
                case ".wks": mime = "application/vnd.ms-works";
		        break;
                case ".WLMP": mime = "application/wlmoviemaker";
		        break;
                case ".wlpginstall": mime = "application/x-wlpg-detect";
		        break;
                case ".wlpginstall3": mime = "application/x-wlpg3-detect";
		        break;
                case ".wm": mime = "video/x-ms-wm";
		        break;
                case ".wma": mime = "audio/x-ms-wma";
		        break;
                case ".wmd": mime = "application/x-ms-wmd";
		        break;
                case ".WMD": mime = "application/x-ms-wmd";
		        break;
                case ".wmf": mime = "application/x-msmetafile";
		        break;
                case ".wml": mime = "text/vnd.wap.wml";
		        break;
                case ".wmlc": mime = "application/vnd.wap.wmlc";
		        break;
                case ".wmls": mime = "text/vnd.wap.wmlscript";
		        break;
                case ".wmlsc": mime = "application/vnd.wap.wmlscriptc";
		        break;
                case ".wmp": mime = "video/x-ms-wmp";
		        break;
                case ".wmv": mime = "video/x-ms-wmv";
		        break;
                case ".wmx": mime = "video/x-ms-wmx";
		        break;
                case ".wmz": mime = "application/x-ms-wmz";
		        break;
                case ".wpl": mime = "application/vnd.ms-wpl";
		        break;
                case ".wps": mime = "application/vnd.ms-works";
		        break;
                case ".wri": mime = "application/x-mswrite";
		        break;
                case ".wrl": mime = "x-world/x-vrml";
		        break;
                case ".wrz": mime = "x-world/x-vrml";
		        break;
                case ".wsc": mime = "text/scriptlet";
		        break;
                case ".wsdl": mime = "text/xml";
		        break;
                case ".wvx": mime = "video/x-ms-wvx";
		        break;
                case ".x": mime = "application/directx";
		        break;
                case ".xaf": mime = "x-world/x-vrml";
		        break;
                case ".xaml": mime = "application/xaml+xml";
		        break;
                case ".xap": mime = "application/x-silverlight-app";
		        break;
                case ".xbap": mime = "application/x-ms-xbap";
		        break;
                case ".xbm": mime = "image/x-xbitmap";
		        break;
                case ".xdr": mime = "text/plain";
		        break;
                case ".xht": mime = "application/xhtml+xml";
		        break;
                case ".xhtml": mime = "application/xhtml+xml";
		        break;
                case ".xla": mime = "application/vnd.ms-excel";
		        break;
                case ".xlam": mime = "application/vnd.ms-excel.addin.macroEnabled.12";
		        break;
                case ".xlc": mime = "application/vnd.ms-excel";
		        break;
                case ".xld": mime = "application/vnd.ms-excel";
		        break;
                case ".xlk": mime = "application/vnd.ms-excel";
		        break;
                case ".xll": mime = "application/vnd.ms-excel";
		        break;
                case ".xlm": mime = "application/vnd.ms-excel";
		        break;
                case ".xls": mime = "application/vnd.ms-excel";
		        break;
                case ".xlsb": mime = "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
		        break;
                case ".xlsm": mime = "application/vnd.ms-excel.sheet.macroEnabled.12";
		        break;
                case ".xlsx": mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
		        break;
                case ".xlt": mime = "application/vnd.ms-excel";
		        break;
                case ".xltm": mime = "application/vnd.ms-excel.template.macroEnabled.12";
		        break;
                case ".xltx": mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
		        break;
                case ".xlw": mime = "application/vnd.ms-excel";
		        break;
                case ".xml": mime = "text/xml";
		        break;
                case ".xmta": mime = "application/xml";
		        break;
                case ".xof": mime = "x-world/x-vrml";
		        break;
                case ".XOML": mime = "text/plain";
		        break;
                case ".xpm": mime = "image/x-xpixmap";
		        break;
                case ".xps": mime = "application/vnd.ms-xpsdocument";
		        break;
                case ".xrm-ms": mime = "text/xml";
		        break;
                case ".xsc": mime = "application/xml";
		        break;
                case ".xsd": mime = "text/xml";
		        break;
                case ".xsf": mime = "text/xml";
		        break;
                case ".xsl": mime = "text/xml";
		        break;
                case ".xslt": mime = "text/xml";
		        break;
                case ".xsn": mime = "application/octet-stream";
		        break;
                case ".xss": mime = "application/xml";
		        break;
                case ".xtp": mime = "application/octet-stream";
		        break;
                case ".xwd": mime = "image/x-xwindowdump";
		        break;
                case ".z": mime = "application/x-compress";
		        break;
                case ".zip": mime = "application/x-zip-compressed";
		        break;
                default: mime = "application/octet-stream";
		        break;
            }
            return mime;
        }
        public static String getCurrentYearForClass()
        {
            DateTime today = DateTime.Now;
            if (today.Month > 8)
                return today.Year.ToString() + "/" + (today.Year + 1).ToString();
            else
                return (today.Year - 1).ToString() + "/" + today.Year.ToString();
        }
    }
}